package com.umeng.analytics.pro;

import android.text.TextUtils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class p implements Serializable {
    private static final long a = 1;
    private Map<String, k> b;

    public p() {
        this.b = new HashMap();
    }

    public void a(f arg2, String arg3) {
        if (this.b.containsKey(arg3)) {
            this.c(arg3);
        } else {
            this.b(arg3);
        }

        arg2.a(this, false);
    }

    public Map a() {
        return this.b;
    }

    public void a(k arg3) {
        if (this.a(arg3.c())) {
            this.b(arg3);
        } else {
            this.b.put(arg3.c(), arg3);
        }
    }

    public boolean a(String arg4) {
        boolean v0;
        if (TextUtils.isEmpty(((CharSequence) arg4))) {
            v0 = false;
        } else {
            Iterator<Map.Entry<String, k>> v2 = this.b.entrySet().iterator();
            do {
                if (v2.hasNext()) {
                    if (!v2.next().getKey().equals(arg4)) {
                        continue;
                    }
                    return true;
                } else {
                    return false;
                }
            }
            while (true);
        }

        return v0;
    }

    public void a(Map arg1) {
        this.b = arg1;
    }

    public void b() {
        this.b.clear();
    }

    private void b(k arg4) {
        this.b.put(arg4.c(), this.b.get(arg4.c()).a(arg4));
    }

    private void b(String arg7) {
        this.b.put(arg7, new k(arg7, System.currentTimeMillis(), 1));
    }

    private void c(String arg3) {
        this.b.put(arg3, this.b.get(arg3).a());
    }
}

